﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using EasyCalcLib;

namespace TestCalc
{
    [TestFixture]
    public class TestCalc
    {
        [Test]
        public void addition()
        {
            Calc c = new Calc(new string[] { "4", "5", "+" });
            Assert.AreEqual(9, c.calculer());
        }

        [Test]
        public void soustraction()
        {
            Calc c = new Calc(new string[] { "10", "5", "-" });
            Assert.AreEqual(5, c.calculer());
        }

        public void multiplication()
        {
            Calc c = new Calc(new string[] { "3", "3", "*" });
            Assert.AreEqual(9, c.calculer());
        }

        [Test]
        public void DivisionEntiere()
        {
            Calc c = new Calc(new string[] { "12", "3", "/" });
            Assert.AreEqual(4, c.calculer());
        }

        [Test]
        public void Division2Decimales()
        {
            Calc c = new Calc(new string[] { "9", "8", "/" });
            Assert.AreEqual(1.12, c.calculer());
        }

        [Test]
        public void DivisionParZero()
        {
            Calc c = new Calc(new string[] { "4", "0", "/" });
            Assert.AreEqual(Double.PositiveInfinity, c.calculer());
        }
    }
}
